package com.shy.portal.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.shy.base.entity.BaseEntity;

/**
 * <p>
 * Title: RoleMenu
 * </p>
 * <p>
 * Description:角色菜单關係實体
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author H2013788
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "portal_role_menu")
public class RoleMenu extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /**
     * 與角色實体外外鍵關係
     */
    @ManyToOne
    private Role role;

    /**
     * 與菜单實体外鍵關係
     */
    @ManyToOne
    private Menu menu;

    /**
     * 描述
     */
    @Column(name = "description")
    private String description;

    /**
     * 是否分配
     */
    @Column(name = "checked")
    private boolean checked; // 是否分配


    /**
     * @return the role
     */
    public Role getRole() {
        return role;
    }

    /**
     * @param role the role to set
     */
    public void setRole(Role role) {
        this.role = role;
    }

    /**
     * @return the menu
     */
    public Menu getMenu() {
        return menu;
    }

    /**
     * @param menu the menu to set
     */
    public void setMenu(Menu menu) {
        this.menu = menu;
    }


    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the checked
     */
    public boolean isChecked() {
        return checked;
    }

    /**
     * @param checked the checked to set
     */
    public void setChecked(boolean checked) {
        this.checked = checked;
    }
}
